;
(function() {
	let hlInfiniteTreeWrap = {
		template: `
			<div class="hl-infinite-tree-wrap">
				<hl-infinite-tree
				v-for="(item, index) in data"
				:data="item"
				:key="index"
				:list="data"
				:level-pl="levelPl"
				:is-operate="isOperate"
				:padding-left="paddingLeft"
				:samelevel="samelevel"
				:equal-name="equalName"
				:lower-name="lowerName"
				:tips="tips"
				@on-edit-click="edit"
				@on-add-click="add"
				@on-del-click="del"
				@on-select-click="select"
				></hl-infinite-tree>
			</div>
		`,
		props: {
			levelPl: {
				type: [Number, String],
				default: 4
			},
			isOperate: {
				type: Boolean,
				default: false
			},
			paddingLeft: {
				type: [Number, String],
				default: 14
			},
			data: {
				type: Array,
				default: () => {
					return []
				}
			},
			tips: {
				type: String,
				default: '请先保存当前信息'
			},
			width: {
				type: [Number, String],
				default: 120
			},
			samelevel: {
				type: Boolean,
				default: false
			},
			equalName: {
				type: String,
				default: '同级'
			},
			lowerName: {
				type: String,
				default: '下级'
			},
		},
		methods: {
			edit (obj) {
				this.$emit('on-edit-save-click', obj)
			},
			add (obj) {
				this.$emit('on-add-save-click', obj)
			},
			del (obj) {
				this.$emit('on-del-click', obj)
			},
			select (obj) {
				this.$emit('on-select-click', obj)
			}
		}
	}

	Vue.component('hl-infinite-tree-wrap', hlInfiniteTreeWrap)
}())
